<%-- 
    Document   : Articulo
    Created on : 27/06/2013, 01:12:53 PM
    Author     : SHAI
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<jsp:useBean id="beanUsr" class="bean.Usuario" scope="session" />
<jsp:useBean id="gArticulo" class="bean.gestionArticulos" scope="session" />             
<jsp:useBean id="Articulo" class="bean.Articulo" scope="session" />    

<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="stylesheet" type="text/css" href="css/style.css">
        <link rel="stylesheet" type="text/css" href="css/styleArticulos.css">
        <title>Gestion de Articulos</title>
    </head>
    <body>
        <jsp:include page="header.jsp"/>
        <div id="main">
            <div id="control">
                <div id="controli">
                    <%
                        int id = Integer.parseInt(request.getParameter("articulo"));
                        if (beanUsr.isActive()) {
                            if (beanUsr.getRol() > 0) {
                                out.print("<a href=\"articulo.jsp?articulo=nuevo\" >Nuevo Articulo</a>");
                                out.print("&nbsp;&nbsp;<a href=\"articulo.jsp?articulo=" + id + "\" >Modificar</a>");
                            }
                        }
                    %>
                </div>
                <div id="controld">
                    <form id="Login" action="listaArticulos.jsp" method="post" >
                        <div class="form_settings">
                            <p><span>Buscar:</span><input class="contact" type="text" name="articulo" value="" /></p>
                        </div>
                    </form>
                </div>
            </div>
            <div id="contenido">
                <%
                    Articulo = gArticulo.getArticulo(id);
                    out.println("<h1>" + Articulo.getTitulo() + "</h1>");
                    out.println("<div id=\"textoLectura\"><textarea id=\"contenidoEditar\" readonly>" + Articulo.getContenido() + "</textarea></div>");
                %>
                
            </div>
            <div id="info">
                <div id="infoi">
                    <%  out.print("&nbsp;&nbsp;Autor: " + Articulo.getAutor() + "</br>");
                        out.print("&nbsp;&nbsp;Fecha: " + Articulo.getFecha() + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Punteo: " + Articulo.getPunteo() + "</br>");
                        out.print("&nbsp;&nbsp;Revision: " + Articulo.getRevision() + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Cantidad de Votos: " + Articulo.getCantidadVotos() + "</br>");
                    %>
                </div>
                <div id="infod">
                    <%
                        if (beanUsr.isActive()) {
                            out.print("Puntuacion: &nbsp;&nbsp;<a href=\"accion.jsp?accion=p&punteo=2&idArt="+id+"&idUsr="+beanUsr.getIdUsuario()+"\" >2</a>");
                            out.print("&nbsp;&nbsp;<a href=\"accion.jsp?accion=p&punteo=4&idArt="+id+"&idUsr="+beanUsr.getIdUsuario()+"\" >4</a>");
                            out.print("&nbsp;&nbsp;<a href=\"accion.jsp?accion=p&punteo=6&idArt="+id+"&idUsr="+beanUsr.getIdUsuario()+"\" >6</a>");
                            out.print("&nbsp;&nbsp;<a href=\"accion.jsp?accion=p&punteo=8&idArt="+id+"&idUsr="+beanUsr.getIdUsuario()+"\" >8</a>");
                            out.print("&nbsp;&nbsp;<a href=\"accion.jsp?accion=p&punteo=10&idArt="+id+"&idUsr="+beanUsr.getIdUsuario()+"\" >10</a>");
                            out.print("&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"accion.jsp?accion=p&punteo=15&idArt="+id+"&idUsr="+beanUsr.getIdUsuario()+"&idRev="+Articulo.getRevision()+"\" >Denunciar</a>");
                        }
                    %>
                </div>
            </div>
        </div>
    </body>
</html>
